home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / Libraries / EditFields / EditFields.h < prev    next >
Text File  |  1992-09-10  |  3KB  |  82 lines

  1. /****************************************************************************************
  2. *
  3. *
  4. *        Edit Field Library- .h Definition File
  5. *
  6. *        9/9/92    Â©ImproVision UK. Written by Graham Cox.
  7. *
  8. ****************************************************************************************/
  9.  
  10. #include    "SANE.h"
  11.  
  12.  
  13. typedef struct
  14. {
  15.     int                    efID;                    /* ID number of the field             */
  16.     Rect                edViewRect;                /* display rect in local coordinates*/
  17.     long                upLimit,lowLimit;        /* limit values for this field        */
  18.     long                edFlags;                /* parameter flags                    */
  19.     struct EditField    **nextField;            /* handle to next field                */
  20.     Str255                edFieldText;            /* text in the field                */
  21. }
  22. EditField, *EditFieldPtr, **EditFieldHdl;
  23.  
  24.  
  25.  
  26. typedef struct
  27. {
  28.     WindowPtr        efOwner;                    /* window that owns the fields        */
  29.     int                currentField;                /* ID of current field being edited    */
  30.     int                numFields;                    /* number of fields in list            */
  31.     EditFieldHdl    efListHead;                    /* Handle to first field in list    */
  32.     TEHandle        efText;                        /* Text Edit Record used to edit    */
  33.     long            userRefCon;                    /* Application available field        */
  34.     long            reserved;                    /* for future use                     */
  35. }
  36. EFList, *EFListPtr, **EFListHdl;
  37.  
  38.  
  39. #define        fieldNoRestriction    0
  40. #define        fieldAlphabetic        1
  41. #define        fieldNumeric        2
  42. #define        fieldUnsigned        4
  43. #define        fieldInteger        8
  44. #define        fieldLongint        16
  45. #define        fieldFloatingPoint    32
  46. #define        fieldNoScroll        64
  47. #define        fieldUpperCase        128
  48. #define        fieldLowerCase        256
  49. #define        fieldIgnoreLimits    512
  50. #define        fieldConvertTicks    1024
  51. #define        fieldDataChanged    2048
  52.  
  53. /* bits above 2048 are reserved for future use */    
  54.  
  55. #define        NIL nil
  56.  
  57.  
  58. /*--------------------------- FUNCTION PROTOTYPES ---------------------------------*/
  59.  
  60.  
  61.  
  62. EditFieldHdl     NewEditField(Rect *bounds,int IDnum,Str255 *theText);
  63. void             LinkEditField(EFListHdl efList,EditFieldHdl eField);
  64. void            Draw1Field(EditFieldHdl theField);
  65. void             SetFieldText(EditFieldHdl theField,Str255 *theText);
  66. void             GetFieldText(EditFieldHdl theField,Str255 *theText);
  67. void            SetFPField(EditFieldHdl theField,extended fpValue,int nDecPlaces);
  68. extended         GetFPField(EditFieldHdl theField);
  69. void             SetEdFlags(EditFieldHdl theField,long theFlags);
  70. long             GetEdFlags(EditFieldHdl theField);
  71. EFListHdl        NewEditFieldList(WindowPtr ownerWindow);
  72. void            DisposeEditFieldList(EFListHdl theList);
  73. EditFieldHdl    GetIndexedField(EFListHdl efList,int theIndex);
  74. void            IncDecCurrentField(EFListHdl efList,Boolean incDecFlag);
  75. void            DrawEditFields(EFListHdl efList);
  76. void             SelectEditField(EFListHdl efList,int theIndex);
  77. int                FindEditField(EFListHdl efList,Point mClick);
  78. void             EFIdle(EFListHdl    efList);
  79. int             CheckFieldLimits(EditFieldHdl theField,EFListHdl efList);
  80. void            KeyField(EFListHdl efList,char theKey);
  81. void            SetAndUpdateField(EFListHdl efList,int theFieldID,long fValue);
  82.